<?php
namespace WinZ\DataMinerBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of PageController
 *
 * @author Winz
 */
// src/Blogger/BlogBundle/Controller/PageController.php
class PageController extends Controller
{
    public function indexAction()
    {
        return $this->render('DataMinerBundle:Page:index.html.twig');
    }
    
    
    public function sellersTableAction() {
        $em = $this->getDoctrine()
                   ->getEntityManager();
        $sellers = $em->getRepository('DataMinerBundle:Character')
                ->findSellersWithGoldFromOrdered();
        return $this->render('DataMinerBundle:Page:sellersTable.html.twig', array(
            'sellers'=>$sellers
        ));        
    }
    
    public function farmersTableAction() {
        $em = $this->getDoctrine()
                   ->getEntityManager();
        $chars = $em->getRepository('DataMinerBundle:Character')
                ->getFarmersOrdered();
        //->findBy(array('isSeller'=>false))
                    ;
        return $this->render('DataMinerBundle:Page:farmersTable.html.twig', array(
            'chars'=>$chars
        ));        

    }    

}
?>
